#!/bin/bash

source /home/shell/util.sh



# 安装函数
function install () {
    rpm -ivh http://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
    rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
    sed -i "s/#baseurl/baseurl/g" /etc/yum.repos.d/epel.repo
    sed -i "s/metalink/#metalink/g" /etc/yum.repos.d/epel.repo
    sed -i "s@https\?://download.fedoraproject.org/pub@https://repo.huaweicloud.com@g" /etc/yum.repos.d/epel.repo
}

# 配置函数
function config(){
    yum update -y
}


# 运行安装和配置
install && config
